package com.itheima.controller;

import com.itheima.pojo.LogQueryParam;
import com.itheima.pojo.OperateLog;
import com.itheima.pojo.PageResult;
import com.itheima.pojo.Result;
import com.itheima.service.EmpLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/log")
@RestController
public class LogController {
    @Autowired
    private EmpLogService empLogService;

    @GetMapping("/page")
    public Result pageLog(LogQueryParam logQueryParam) {
        log.info("查询了日志:{}", logQueryParam);
        PageResult<OperateLog> page = empLogService.page(logQueryParam);
        return Result.success(page);
    }
}
